#ifndef MYHTMLCTRL_2011_11_23_H_
#define MYHTMLCTRL_2011_11_23_H_
#pragma once
#include <afxhtml.h>

#define MAX_ENABLE 10

class myHtmlCtrl : public CHtmlView
{
public:

	myHtmlCtrl(BOOL bNewWindow = FALSE);

	virtual ~myHtmlCtrl(){ };

	virtual char* GetCurrentURL();

	virtual void SetHWND(HWND hWnd);

	virtual void EnableRClick(char *URL = NULL);

	virtual void EnbaleOpenWindow(char *URL = NULL);

	virtual void EnableScroll(char *URL = NULL);

	virtual void DisableStuff();

protected:

	bool m_EnableWindow;
	bool m_EnableScroll;
	bool m_EnableRClick;
	bool m_DisableStuff;

	HWND m_MainhWnd;

	CString m_CurrentURL;

	CString m_BoxRClick[MAX_ENABLE];
	CString m_BoxNScroll[MAX_ENABLE];
	CString m_BoxNWindow[MAX_ENABLE];

	char m_Log[1024];

	HRESULT OnGetHostInfo(DOCHOSTUIINFO *pInfo);

	virtual BOOL PreTranslateMessage(MSG *pMsg);

	virtual void OnNewWindow2(LPDISPATCH *ppDisp, BOOL *Cancel);
	virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel);

	DECLARE_DYNCREATE(myHtmlCtrl)
	DECLARE_MESSAGE_MAP()
};

#endif